fix: use basename(workspace) instead of repoName for workspaceFolder#126
fix: use basename(workspace) instead of repoName for workspaceFolder#126sdiazbarraza wants to merge 2 commits into
Conversation
The override config was setting workspaceFolder to /workspaces/{repoName} instead of /workspaces/{basename(workspace)}, causing container exec to fail when branch folder name differs from repo name (e.g. feature/login vs carro-smart)
Adds a test case that verifies basename(workspace) is used for workspaceFolder and container name, taking precedence over the repoName parameter when both are provided.
|
I encountered the same issue. repoName is devcontainer_demo, "/devcontainer new_a" clone to ~/.local/share/opencode/clone/devcontainer_demo/new_d. --workspace-folder is used as ~/.local/share/opencode/clone/devcontainer_demo/new_d, and the path in the created Docker container is /workspaces/new_d. In override-config, workspaceFolder is the repo name, that is, devcontainer_demo. The error log in jobs.json is as follows: I am not very familiar with devcontainer. I asked opencode to help me locate the fault. The explanation is as follows: I am not sure whether this is correct or whether it is related to the DinD deployment. (I started the docker daemon in the Kubernetes pod and executed opencode /devcontainer.) |
Summary
basename(workspace)instead ofrepoNameforworkspaceFolderand containernameingenerateOverrideConfigbasename(workspace)takes precedence overrepoNamewhen both are providedChanges
Fix (config.js)
Test (config.test.js)
basename(workspace)forworkspaceFolderprefers basename(workspace) over repoName when both providedTesting
Checklist
npm test)